// ***************************************************************
//  IStartable.cs   version:  1.0    date: 05/11/2006
//  -------------------------------------------------------------
//	author:		Yangjun Deng
// 	email:		Midapexsoft@gmail.com
// 	purpose:	Declare the IStartable interface and define StartableArgs class
//  -------------------------------------------------------------
//  Copyright (C) 2006 - Midapexsoft All Rights Reserved
// ***************************************************************
using System;

namespace Midapex.SmartOrm
{
	/// <summary>
	/// Interface for type that can be started
	/// </summary>
	public interface IStartable
	{
		void Start();
		void Stop();

		bool CanStart
		{
			get;
			set;
		}

        bool IsRun
        {
            get;
        }

        event EventHandler<StartableArgs> OnStartableStatueChange;
	}

    public class StartableArgs : System.EventArgs
    {
        IStartable startableObject;

        public IStartable StartableObject
        {
            get { return startableObject; }
        }

        public StartableArgs(IStartable startableObject)
        {
            this.startableObject = startableObject;
        }
    };

}
